<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<ui:composition template="/pages/layout/mainLayout.xhtml">
	<ui:define name="bodyComUsuario">
		<div class="post">
		<h2 class="title"><h:outputText
			value="#{bundle['locanet.copiaFilme.busca.titulo']}" /></h2>
		<h:form>
			<h:panelGrid columns="2">
				<h:outputLabel value="#{bundle['locanet.Filme.codigo']}" />
				<h:inputText maxlength="100" value="#{copiaFilmeBean.entity.codigo}" />

				<h:outputLabel value="#{bundle['locanet.status']}" />
				<p:column>
					<h:selectOneRadio value="#{copiaFilmeBean.entity.status}">
						<f:selectItem itemLabel="#{bundle['locanet.entidades.status.ativo']}" itemValue="1" />
						<f:selectItem itemLabel="#{bundle['locanet.entidades.status.locado']}" itemValue="2" />
						<f:selectItem itemLabel="#{bundle['locanet.entidades.status.inativo']}" itemValue="0" />
					</h:selectOneRadio>
				</p:column>

				<h:commandButton value="#{bundle['locanet.butoes.buscar']}" action="#{copiaFilmeBean.search}" />
				<h:commandLink immediate="true" action="#{copiaFilmeBean.openInsert}">
					<h:outputText value="#{bundle['locanet.butoes.inserir']}" />
				</h:commandLink>
			</h:panelGrid>
		</h:form></div>
		<h:form>
		<div class="post"><p:dataTable styleClass="table_busca"
			rendered="#{!empty copiaFilmeBean.entities}"
			value="#{copiaFilmeBean.entities}" var="cf">
			<p:column>
				<h:commandLink value="#{bundle['locanet.entidades.lista.editar']}"
					action="#{copiaFilmeBean.openUpdate}" >
					<f:setPropertyActionListener value="#{cf.id}"
						target="#{copiaFilmeBean.entity.id}" />
				</h:commandLink>
			</p:column>

			<p:column>
				<h:commandLink value="#{bundle['locanet.entidades.lista.excluir']}"
					action="#{copiaFilmeBean.remove}" immediate="true">
					<f:setPropertyActionListener value="#{cf.id}"
						target="#{copiaFilmeBean.entity.id}" />
				</h:commandLink>
			</p:column>

			<p:column>
				<f:facet name="header">
					<h:outputText value="#{bundle['locanet.Filme.codigo']}" />
				</f:facet>
				<h:outputText value="#{cf.codigo}" />
			</p:column>

			<p:column>
				<f:facet name="header">
					<h:outputText value="#{bundle['locanet.Filme.filme']}" />
				</f:facet>
				<h:commandLink immediate="true" value="#{cf.filme.titulo}"
					action="#{filmeBean.view}">
					<f:setPropertyActionListener value="#{cf.filme.id}"
						target="#{filmeBean.entity.id}" />
				</h:commandLink>
			</p:column>

			<p:column>
				<f:facet name="header">
					<h:outputText value="#{bundle['locanet.status']}" />
				</f:facet>
				<font style="color: green"><h:outputText
					rendered="#{cf.status==1}"
					value="#{bundle['locanet.entidades.status.ativo']}" /></font>
				<font style="color: #CCCC00"><h:outputText
					rendered="#{cf.status==2}"
					value="#{bundle['locanet.entidades.status.locado']}" /></font>
				<font style="color: red"><h:outputText
					rendered="#{cf.status==0}"
					value="#{bundle['locanet.entidades.status.inativo']}" /></font>
			</p:column>

			<p:column>
				<f:facet name="header">
					<h:outputText value="#{bundle['locanet.copiaFilme.locar']}" />
				</f:facet>
				<h:commandLink action="#{locacaoBean.addNoCarrinho}" value="Adicionar a Locacao">
					<f:setPropertyActionListener value="#{cf.id}" target="#{locacaoBean.entity.id}"/>
				</h:commandLink>
			</p:column>
		</p:dataTable></div>
		</h:form>
	</ui:define>
</ui:composition>
</html>